import { request } from "@utils/http";

import type {
    hospitalListParamType,
    hospitalRetrunType,
    provinceType,
    hospitalDetailReturnType
} from "@api/hospital/model/hospitalListType"

//分页列表请求
export const hospitalListGetDataRequest = ({ page, limit }: { page: number, limit: number }, data: hospitalListParamType) => {
    return request.get<any, hospitalRetrunType>(`/admin/hosp/hospital/${page}/${limit}`, {
        params: {
            ...data
        }
    })
}

//三级联动之获取省份
export const getProvinceRequest = () => {
    return request.get<any, provinceType>(`/admin/cmn/dict/findByDictCode/province`)
}
//三级联动之获取市或者区
export const getCityOrDistrictCodeRequest = (id: string) => {
    return request.get<any, provinceType>(`/admin/cmn/dict/findByParentId/${id}`)
}

//获取医院类型的请求
export const getHosListTypeRequest = () => {
    return request.get<any, provinceType>("/admin/cmn/dict/findByParentId/10000")
}
//改变医院上下线状态的回调
export const changeHosListStatusRequest = (id:string,status:number) => {
    return request.get<any,null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}
//4.请求医院详情信息
export const getHosListDetailRequest = (id: string) => {
    return request.get<any, hospitalDetailReturnType>(`/admin/hosp/hospital/show/${id}`)
  }